from selenium.webdriver.common.by import By

from base import BaseAction


class IndexPageHome(BaseAction):
    #     定义元素
    look_ele = By.CSS_SELECTOR, '.ibtn'  # 详情
    menu_sy = By.XPATH, '//*[text()="首页"]'
    menu_yx = By.XPATH, '//*[@class="left-nav"]/div/div[2]/div/div/div'  # 隐形正畸
    menu_gd = By.XPATH, '//*[@class="left-nav"]/div/div[3]'  # 固定正畸
    menu_xf = By.XPATH, '//*[@id="YS-xf"][1]'  # 修复
    menu_zz = By.XPATH, '//*[@id="YS-xf"][2]'  # 种植
    menu_gt = By.XPATH, '//*[@id="YS-gt"]'  # 沟通
    # quit1_ele = By.XPATH, '//*[@id="app"]/div[1]/div/div[3]/span/img'  # 公测进入退出按钮
    quit1_ele = By.XPATH, '//*[@id="app"]/div[1]/div/div[2]/span/img'  # 内测进入退出按钮
    quit2_ele = By.XPATH, '//*[text()="退出登录"]'
    quit3_ele = By.XPATH, '//*[@id="yg_msgbox_dom"]//input[1][@class="okbtn"]'  # 确认退出
    center1_ele = By.XPATH, '//*[text()="个人中心"]'
    center2_ele = By.XPATH, '//*[text()="管理"][1]'  # 进入加工厂
    order_list_success_ele = By.XPATH, '//*[text()="去下单"]'
    use_success_ele = By.XPATH, '//*[text()="详情"]'

    def get_look_ele(self):
        return self.get_element(self.look_ele)

    def get_menu_sy_ele(self):
        return self.get_element(self.menu_sy)

    def get_menu_yx_ele(self):
        return self.get_element(self.menu_yx)

    def get_menu_gd_ele(self):
        return self.get_element(self.menu_gd)

    def get_menu_xf_ele(self):
        return self.get_element(self.menu_xf)

    def get_menu_zz_ele(self):
        return self.get_element(self.menu_zz)

    def get_menu_gt_ele(self):
        return self.get_element(self.menu_gt)

    def get_quit1_ele(self):
        return self.get_element(self.quit1_ele)

    def get_quit2_ele(self):
        return self.get_element(self.quit2_ele)

    def get_quit3_ele(self):
        return self.get_element(self.quit3_ele)

    def get_center1_ele(self):
        return self.get_element(self.center1_ele)

    def get_center2_ele(self):
        return self.get_element(self.center2_ele)

    def get_use_sucess_ele(self):
        return self.get_element(self.use_success_ele)

    def get_order_list_success_ele(self):
        return self.get_element(self.order_list_success_ele)
